// attendanceView.cpp : implementation of the CAttendanceView class
//

#include "stdafx.h"
#include "attendance.h"

#include "attendanceDoc.h"
#include "attendanceView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAttendanceView

IMPLEMENT_DYNCREATE(CAttendanceView, CView)

BEGIN_MESSAGE_MAP(CAttendanceView, CView)
	//{{AFX_MSG_MAP(CAttendanceView)
	ON_WM_ERASEBKGND()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAttendanceView construction/destruction

CAttendanceView::CAttendanceView()
{
	// TODO: add construction code here
	CBitmap bmp;
	//bmp.LoadBitmap(IDB_BITMAP1);
	bmp.LoadBitmap(IDB_BMP_BG);
	m_brushBackground.CreatePatternBrush(&bmp);
}

CAttendanceView::~CAttendanceView()
{
}

BOOL CAttendanceView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAttendanceView drawing

void CAttendanceView::OnDraw(CDC* pDC)
{
	CAttendanceDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	CRect rect;
	GetClientRect(rect);
	pDC->FillRect(rect, &m_brushBackground);
}

/////////////////////////////////////////////////////////////////////////////
// CAttendanceView diagnostics

#ifdef _DEBUG
void CAttendanceView::AssertValid() const
{
	CView::AssertValid();
}

void CAttendanceView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CAttendanceDoc* CAttendanceView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAttendanceDoc)));
	return (CAttendanceDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAttendanceView message handlers

BOOL CAttendanceView::OnEraseBkgnd(CDC* pDC) 
{
	// TODO: Add your message handler code here and/or call default
	
	//return CView::OnEraseBkgnd(pDC);
	return TRUE;
}
